Skip to content

Instantly share code, notes, and snippets.

@plembo
plembo / firefox-bookmarks-backup-html.md
Last active May 14, 2024 11:24
Bookmarks backup to HTML for Firefox

Automatically backing up Firefox bookmarks to HTML

By default, Firefox automatically backs up your current bookmarks to a .json file under the current user profile, usually a path like ".mozilla/firefox/xxxx.default/bookmarkbackups". Some of us still like to work with the old-school HTML export instead.

To enable automatic backups of bookmarks to HTML, you need to add the following through either "about:config" or in the optional user.js config file (where customizations to prefs.js can be added). The backup will be created and then overwritten every time the browser is closed.

If doing this through about:config, search for browser.bookmarks.autoExportHTML (if it doesn't exist, create it as a boolean item), and set to true. Then create the browser.bookmarks.file item as a string item and enter the full path for the file (e.g., /home/myuser/bookmarks.html, where "myuser" is your login name on the system).

Before making the change in user.js (located at ~/.mozilla/firefox/xxx.default, if it doesn't exist c

//
// ContentView.swift
// AppleMusicLyricsPlayer
//
// Created by Magesh Sridhar on 2/5/23.
//
import SwiftUI
import AVKit
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 14, 2024 11:24
set -e, -u, -o, -x pipefail explanation
@ahemwe
ahemwe / calendar.php
Created May 28, 2014 19:36
php caldav to ical converter for mailbox.org
<?php
$userpwd = '<user>:<pwd>';
$baseurl = 'https://dav.mailbox.org/';
header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: attachment; filename=Kalender.ics');
// new cURL-Handle
$ch = curl_init();
@HarmJ0y
HarmJ0y / PowerView-3.0-tricks.ps1
Last active May 14, 2024 11:20
PowerView-3.0 tips and tricks
# PowerView's last major overhaul is detailed here: http://www.harmj0y.net/blog/powershell/make-powerview-great-again/
# tricks for the 'old' PowerView are at https://gist.github.com/HarmJ0y/3328d954607d71362e3c
# the most up-to-date version of PowerView will always be in the dev branch of PowerSploit:
# https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/PowerView.ps1
# New function naming schema:
# Verbs:
# Get : retrieve full raw data sets
# Find : ‘find’ specific data entries in a data set
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 14, 2024 11:20
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@nchevobbe
nchevobbe / screenshot.js
Last active May 14, 2024 11:17
Log a data URL containing a screenshot of the window
let canvas = window.document.createElementNS("http://www.w3.org/1999/xhtml", "html:canvas");
let context = canvas.getContext("2d");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
context.drawWindow(window, 0, 0, canvas.width, canvas.height, "white");
console.log(`
📸 📸 📸 📸
${canvas.toDataURL()}
@rsms
rsms / macos-distribution.md
Last active May 14, 2024 11:15
macOS distribution — code signing, notarization, quarantine, distribution vehicles
@wojteklu
wojteklu / clean_code.md
Last active May 14, 2024 11:15
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules